package plugin.client;

public abstract class ClientPlugin {
	
	protected java.net.Socket servSocket = null;
	protected String jarFileName = null;
	protected String pluginDir = "ClientPlugins";
	
	public ClientPlugin()
	{
	}
	
	public void setServerSocket(java.net.Socket servSocket)
	{
		this.servSocket = servSocket;
	}
	
	public void setJarFileName(String name)
	{
		this.jarFileName = name;
	}
	
	public void setPluginsDir(String dir)
	{
		this.pluginDir = dir;
	}
	
	//Operating system with which a plugin might be compatible with
	public static enum OS{Windows, Linux, Mac, All};
	
	//unique identifier of plugin (note that if there are several versions for different 
	//OSs of the same plugin, name doesn't have to be unique for them)
	public abstract String getName();
	
	//what OS is it compatible with
	public abstract OS getOS();
	
	//returns current version of plugin
	public abstract float getVersion();
	
	//runs the plugin
	public abstract void trigger();
	
	//if triggeredByCommand return true, this method will trigger the plugin if the command is correct and might return some value (or null)
	public abstract String trigger(String command);
	
	//returns true if plugin is a function triggered by some command
	//if false, try calling trigger() method to start
	public abstract boolean triggeredByCommand();
	
	//returns true if plugin might be triggered by specific command
	public abstract boolean triggeredByCommand(String command);
	
	//if permanently working plugin, this method should be able to stop it
	public abstract void stop();

}
